/**
 * Created by admin on 2017/4/24.
 */


(function ($, document) {
    /*------------------初始化字段-------------------------------*/


    var usertype1 = ""; //用户身份
    var education1 = "";//教育程度
    var marriage1 = "";//婚姻状况

    /*-----工薪------*/
    var giveOut1 = "";//工资发放形式
    var car1 = "";//名下有无车产
    var house1 = "";//名下有无房产
    var security1 = "";//有无连续6个月以上缴纳社保
    var accumulationFund1 = "";//有无连续6个月以上缴纳公积金
    var credit1 = "";//有无信用卡

    var lou_workcity1 = "";//公司地址
    var entryTime1 = "";//入职时间
    /*-----企业-----*/
    var companyType1;//企业类型
    var liabilitySituation1;//负债情况
    var companyIndustry1;//公司行业
    var companyCar1;//企业明下有无车产
    var companyHouse1;//企业明下有无房产


    /*-----------------初始化PopPicker对象-----------------------*/
    var info={};
    info.usertype = new $.PopPicker();
    info.education = new $.PopPicker();
    info.marriage = new $.PopPicker();
    info.contact = new $.PopPicker();
    info.contact_relation = new $.PopPicker();
    /*-----工薪------*/
    info.giveOut = new $.PopPicker();
    info.car = new $.PopPicker();
    info.house = new $.PopPicker();
    info.security = new $.PopPicker();
    info.accumulationFund = new $.PopPicker();
    info.credit = new $.PopPicker();
    info.cityPicker = new $.PopPicker({layer: 2});
    info.myDate = new Date();
    info.nowYear = info.myDate.getFullYear();

    /*-----企业-----*/
    info.companyType = new $.PopPicker();
    info.liabilitySituation = new $.PopPicker();
    info.companyIndustry = new $.PopPicker();
    info.companyCar = new $.PopPicker();
    info.companyHouse = new $.PopPicker();

    /*------------------给初始化PopPicker对象赋值----------------*/
    var options = JSON.parse('{"type":"date","beginYear":"1949","endYear":' + info.nowYear + '}');
    var entryTime = new $.DtPicker(options);
    info.cityPicker.setData(cityData);
    info.usertype.setData([
        {
            value: 1,
            text: '在职人员'
        }, {
            value: 2,
            text: '企业负责人'
        }, {
            value: 3,
            text: '自由职业'
        }, {
            value: 4,
            text: '失业人员'
        }, {
            value: 5,
            text: '退休人员'
        }, {
            value: 6,
            text: '个体工商户'
        }, {
            value: 7,
            text: '个体经营者'
        }, {
            value: 8,
            text: '学生'
        }
    ]);
    info.education.setData([
        {
            value: 1,
            text: '初中以下'
        }, {
            value: 2,
            text: '初中'
        }, {
            value: 3,
            text: '高中/中专/技校'
        }, {
            value: 4,
            text: '专科'
        }, {
            value: 5,
            text: '本科'
        }, {
            value: 6,
            text: '硕士'
        }, {
            value: 7,
            text: '博士及以上'
        }
    ]);
    info. marriage.setData([
        {
            value: 1,
            text: '未婚'
        }, {
            value: 2,
            text: '已婚'
        }, {
            value: 3,
            text: '离婚/丧偶'
        }
    ]);
    info.contact.setData([
        {
            value: 1,
            text: '配偶'
        }, {
            value: 2,
            text: '父母'
        }, {
            value: 3,
            text: '兄弟'
        }, {
            value: 4,
            text: '姐妹'
        }, {
            value: 5,
            text: '子女'
        }
    ]);
    info.contact_relation.setData([
        {
            value: 6,
            text: '同学'
        }, {
            value: 7,
            text: '亲戚'
        }, {
            value: 8,
            text: '同事'
        }, {
            value: 9,
            text: '朋友'
        }, {
            value: 10,
            text: '其他'
        }
    ]);
    info.giveOut.setData([
        {
            value: 1,
            text: '银行卡代发'
        }, {
            value: 2,
            text: '转账工资'
        }, {
            value: 3,
            text: '现金发放'
        }, {
            value: 4,
            text: '自由职业收入'
        }
    ]);
    info.car.setData([
        {
            value: 1,
            text: '无车产'
        }, {
            value: 2,
            text: '有车产无抵押'
        }, {
            value: 3,
            text: '有车产已抵押'
        }
    ]);
    info.house.setData([
        {
            value: 1,
            text: '自置无按揭'
        }, {
            value: 2,
            text: '自置有按揭'
        }, {
            value: 3,
            text: '亲属楼宇'
        }, {
            value: 4,
            text: '集体宿舍'
        }, {
            value: 5,
            text: '租房'
        }, {
            value: 6,
            text: '自建房'
        }, {
            value: 7,
            text: '共有'
        }, {
            value: 8,
            text: '有商铺/商住两用'
        }, {
            value: 9,
            text: '其他'
        }
    ]);
    info.security.setData([
        {
            value: 0,
            text: '无'
        }, {
            value: 1,
            text: '有'
        }
    ]);
    info.accumulationFund.setData([
        {
            value: 0,
            text: '无'
        }, {
            value: 1,
            text: '有'
        }
    ]);
    info.credit.setData([
        {
            value: 0,
            text: '无'
        }, {
            value: 1,
            text: '有'
        }
    ]);
    /*------企业-------*/
    info.companyType.setData([
        {
            value: 1,
            text: '政府'
        }, {
            value: 2,
            text: '事业单位'
        }, {
            value: 3,
            text: '国有企业'
        }, {
            value: 4,
            text: '上市公司'
        }, {
            value: 5,
            text: '民营企业'
        }
    ]);
    info.liabilitySituation.setData([
        {
            value: 1,
            text: '有'
        }, {
            value: 0,
            text: '无'
        }
    ]);
    info.companyIndustry.setData([
        {
            value: 1,
            text: '批发/零售'
        }, {
            value: 2,
            text: '制造业'
        }, {
            value: 3,
            text: '金融/保险/证券'
        }, {
            value: 4,
            text: '住宿/餐饮/旅游'
        }
    ]);
    info.companyCar.setData([
        {
            value: 1,
            text: '无车产'
        }, {
            value: 2,
            text: '有车产无抵押'
        }, {
            value: 3,
            text: '有车产已抵押'
        }
    ]);
    info.companyHouse.setData([
        {
            value: 1,
            text: '自置无按揭'
        }, {
            value: 2,
            text: '自置有按揭'
        }, {
            value: 3,
            text: '亲属楼宇'
        }, {
            value: 4,
            text: '集体宿舍'
        }, {
            value: 5,
            text: '租房'
        }, {
            value: 6,
            text: '自建房'
        }, {
            value: 7,
            text: '公有'
        }, {
            value: 8,
            text: '有商铺/商住两用'
        }, {
            value: 9,
            text: '其他'
        }
    ]);

    /*-------------------------定义公共方法(绑定数据)----------------------------*/

    function pickevent(mm, nn, cc, dd) {
        document.getElementById(mm).addEventListener('tap', function () {
            if (mm.indexOf("Time") > 0) {
                nn.show(function (e) {
                    document.getElementById(dd).innerText = e.text;
                });
            } else {
                if (mm == "usertype") {
                    nn.show(function (e) {
                        document.getElementById(dd).innerText = e[0].text;
                        cc = e[0].value;
                        if (cc == 2 || cc == 6 || cc == 7) {
                            document.getElementsByClassName("other_contact").item(0).style.display = "none";
                            document.getElementsByClassName("company_info").item(0).style.display = "block";
                        } else {
                            document.getElementsByClassName("other_contact").item(0).style.display = "block";
                            document.getElementsByClassName("company_info").item(0).style.display = "none";
                        }
                        document.getElementById(mm).style.color = 'black';
                        sessionStorage.setItem(dd, cc);

                    });
                } else {
                    var usertypes = sessionStorage.getItem("usertype1");
                    if (!usertypes) {
                        mui.alert("请选择职业身份", '提示', function () {
                            console.log(3)
                        });
                        throw "1";
                    } else {
                        nn.show(function (e) {

                            document.getElementById(dd).innerText = e[0].text;
                            cc = e[0].value;
                            console.log(cc);
                            document.getElementById(mm).style.color = 'black';
                            sessionStorage.setItem(dd, cc);
                        });

                    }
                }
            }
        }, false);
    }

    function pickeventcity(mm, nn, cc, dd) {
        document.getElementById(mm).addEventListener('tap', function () {
            nn.show(function (items) {
                document.getElementById(dd).innerText = items[0].text + items[1].text;
                cc = items[0].text + items[1].text;
                var aaa = items[1].value;
                console.log(cc);
                sessionStorage.setItem(dd, cc);
                sessionStorage.setItem(dd + "_code", aaa);
                document.getElementById(mm).style.color = 'black';
                //返回 false 可以阻止选择框的关闭
                //return false;
            });
        }, false);
    }

    /*------------------------绑定pickevent----------------------------*/
    pickevent('usertype', info.usertype, usertype1, "usertype1");//紧急联系人
    pickevent('education', info.education, education1, "education1");//教育程度
    pickevent('marriage', info.marriage, marriage1, "marriage1");//婚姻状况
    /* pickevent('contact', contact, contact1, "contact1");//直系联系人*/
    /* pickevent('contactRelation', contact_relation, contact_relation1, "contact_relation1");//其他联系人*/
    pickevent('giveOut', info.giveOut, giveOut1, "giveOut1");//工资发放形式
    pickevent('car', info.car, car1, "car1");//是否有车产
    pickevent('house', info.house, house1, "house1");//是否有房产
    pickevent('security', info.security, security1, "security1");//有无连续6个月以上缴纳社保
    pickevent('accumulationFund', info.accumulationFund, accumulationFund1, "accumulationFund1");//有无连续6个月以上缴纳公积金
    pickevent('credit', info.credit, credit1, "credit1");//有无信用卡
    /* pickeventcity('conpanycity', cityPicker, lou_workcity1, "lou_workcity1"); //公司位置*/
    /*  pickevent('entryTime', entryTime, entryTime1, 'entryTime1');//入职时间*/
    /*------企业-------*/
    pickevent('companyType', info.companyType, companyType1, 'companyType1');
    pickevent('liabilitySituation', info.liabilitySituation, liabilitySituation1, 'liabilitySituation1');
    pickevent('companyIndustry', info.companyIndustry, companyIndustry1, 'companyIndustry1');
    pickevent('companyCar', info.companyCar, companyCar1, 'companyCar1');
    pickevent('companyHouse', info.companyHouse, companyHouse1, 'companyHouse1');

window.info=info;

})(mui, document);
$(function () {

    function OnLoadInfo() {
        var flag = util.GetQueryString("flag");
        if (flag == 2) {
            var header = tool.header();
            header.public_key = util.GetQueryString("public_key");//获取公钥
            header.app_key = util.GetQueryString("app_key");//获取app标识
            header.source = util.GetQueryString("source");//用户来源
            header.client_id = util.GetQueryString("client_id");//用户手机唯一标识
            header.channel = util.GetQueryString("channel");//打包渠道
            header.app_version = util.GetQueryString("app_version");//APP版本号
            header.timestamp = new Date().getTime();//提交请求头时间戳

            var data = {
                user_id: util.GetQueryString("user_id")
            };
            var paramsStr = getparamsStr(data);
            var signaturesign = header.public_key + header.app_key + header.source + header.channel + header.client_id + header.app_version + paramsStr + header.timestamp;
            //签名信息MD5加密
            var signaturesignature = hex_md5(signaturesign);
            header.signature = signaturesignature;
            var urls = tool.httpsUrl + "";
            tool.ajax(urls, header, data, function (data) {


                console.log(data);
            });
        }
    }
    OnLoadInfo();


    sessionStorage.setItem("usertype1", ""); //用户身份
    sessionStorage.setItem("education1", "");//教育程度
    sessionStorage.setItem("marriage1", "");//婚姻状况
    sessionStorage.setItem("giveOut1", "");//工资发放形式
    sessionStorage.setItem("car1", "");//名下有无车产
    sessionStorage.setItem("house1", "");//名下有无房产
    sessionStorage.setItem("security1", "");//有无连续6个月以上缴纳社保
    sessionStorage.setItem("accumulationFund1", "");//有无连续6个月以上缴纳公积金
    sessionStorage.setItem("credit1", "");//有无信用卡

    var alertInfo = {
        usertype1: '请选择职业身份',
        education1: '请选择教育程度',
        marriage1: '请选择婚姻状况',
        giveOut1: '请选择工资发放形式',
        car1: '请选择有无车产',
        house1: '请选择有无房产',
        security1: '请选择是否连续6个月以上缴社保',
        accumulationFund1: '请选择是否连续6个月以上缴纳公积金',
        credit1: '请选择是否有信用卡',
        lou_wages_income: '请填写月收入信息',
        company_type:'请选择公司类型',
        debt_state:'请选择公司负债情况',
        industry_type:'请选择公司行业',
        license_years:'请输入营业执照至今年限',
        bank_dgls: '请输入对公流水量',
        bank_dsls: '请输入对私流水量'
    };
    var consume_time;

    function IfHaveValue(aa, bb) {
        if (aa == "" || aa == undefined || aa.length == 0) {
            var info = "";
            for (var j in alertInfo) {
                if (j == bb) {
                    info = alertInfo[j];
                }
            }
            mui.alert(info, '提示', function () {
                console.log(3)
            });
            throw "1";
        }
    }

    /*/!*--------------------联系人填写操作----------------------------------------*!/
     $('#linkMan').click(function () {
     var usertypes = sessionStorage.getItem("usertype1");
     if (!usertypes) {
     mui.alert("请选择职业身份", '提示', function () {
     console.log(3)
     });
     throw "1";
     } else {
     $("#linkManDetail").css("display", "block");
     consume_time = Date.parse(new Date());
     }
     });
     /!*--------------------职业信息填写操作----------------------------------------*!/
     $('#profession').click(function () {
     var usertypes = sessionStorage.getItem("usertype1");
     if (!usertypes) {
     mui.alert("请选择职业身份", '提示', function () {
     console.log(3);
     });
     throw "1";
     } else {
     $('#professionDetail').css("display", "block");
     consume_time = Date.parse(new Date());
     }
     });*/
    localStorage.setItem("user_id", util.GetQueryString("user_id"));//userID
    localStorage.setItem("public_key", util.GetQueryString("public_key"));//获取公钥
    localStorage.setItem("app_key", util.GetQueryString("app_key"));//获取app标识
    localStorage.setItem("source", util.GetQueryString("source"));//用户来源
    localStorage.setItem("client_id", util.GetQueryString("client_id"));//用户手机唯一标识
    localStorage.setItem("channel", util.GetQueryString("channel"));//打包渠道
    localStorage.setItem("app_version", util.GetQueryString("app_version"));//APP版本号
    localStorage.setItem("flag", util.GetQueryString("flag"));//APP版本号

    /*--------------------联系人职业信息返回按钮----------------------------------*/
    $(".back").click(function () {
        $("#linkManDetail").css("display", "none");
        $('#professionDetail').css("display", 'none');
    });
    function tishi() {
        var usertypes = sessionStorage.getItem("usertype1");
        if (!usertypes) {
            mui.alert("请选择职业身份", '提示', function () {
                console.log(3);
            });
            throw "1";
        }
    }

    var val;
    /*------------------------公司座机号码输入-----------------------------------*/
    $('#companyPhone').keyup(function (e) {
        var value = $(this).val();
        if (e.keyCode != "8") {
            if (value.length == 3) {
                $(this).val(value + "-");
            }
        }
        val = $(this).val();
    }).blur(function () {
        var retu = util.tel(val);
        if (retu != "1") {
            mui.alert("请正确输入电话号码", '提示', function () {
                $('#companyPhone').focus();
            });
            throw "1";
        }
    });

    $('.other_contact').click(function () {
        tishi();
    });
    $('.company_info').click(function () {
        tishi();
    });
    var paramsStr = "";
    /*-----------------------字段名排序--------------------------------------*/
    function getparamsStr(dataContact) {
        var c;
        var a = [];
        $.each(dataContact, function (key, val) {
            a[a.length] = key;
        });
        a.sort();
        $.each(a, function (i, key) {
            c += encodeURI("&" + key + "=" + dataContact[key]);
            //c += "&"+key+"="+dataContact[key];
        });
        paramsStr = c.split("undefined&")[1];
        return paramsStr;
    }

    /*---------------------字段名排序（紧急联系人）--------------------------*/
    function getencodeURIComponent(dataContact) {
        var c;
        var a = [];
        $.each(dataContact, function (key, val) {
            a[a.length] = key;
        });
        a.sort();
        $.each(a, function (i, key) {
            c += encodeURI("&" + key + "=" + dataContact[key]);
            //c += "&"+key+"="+dataContact[key];
        });
        paramsStr = c.split("undefined&")[1];
        var reg = /,/g;
        var regs = /:/g;
        paramsStr = paramsStr.replace(reg, '%2C');
        paramsStr = paramsStr.replace(regs, '%3A');
        return paramsStr;
    }

    /*----------------------------下一步按钮操作-----------------------------------*/
    $('#next').click(function () {
        var data = "";
        var dataContact = {
            house_fund_state: '',
            car_state: '',
            own_credit: '',
            edu_level: '',
            payroll_mode: '',
            house_state: '',
            month_income: '',
            marry_state: '',
            social_security_state: '',
            social_identity: '',
            user_id: ""
        };
        var dataCompany = {
            user_id: '',
            social_identity: '',
            edu_level: '',
            marry_state: '',
            car_state: '',
            house_state: '',
            company_type: '',
            debt_state: '',
            industry_type: '',
            license_years: '',
            bank_dgls: '',
            bank_dsls: ''
        };
        /*  for (var i in data) {
         var info = data[i];
         IfHaveValue(info, i);
         }*/
        var usertype = sessionStorage.getItem("usertype1");
        if (usertype == 2 || usertype == 6 || usertype == 7) {
            dataCompany.social_identity = sessionStorage.getItem("usertype1"); //用户身份
            dataCompany.edu_level = sessionStorage.getItem("education1");//教育程度
            dataCompany.marry_state = sessionStorage.getItem("marriage1");//婚姻状况
            dataCompany.company_type = sessionStorage.getItem("companyType1");//公司类型
            dataCompany.debt_state = sessionStorage.getItem("liabilitySituation1");//公司负债情况
            dataCompany.industry_type = sessionStorage.getItem("companyIndustry1");//公司行业
            dataCompany.car_state = sessionStorage.getItem("companyCar1");//公司名下是否有车产
            dataCompany.house_state = sessionStorage.getItem("companyHouse1");//公司名下是否有房产
            dataCompany.license_years = $('#businessLicense').val();//营业执照至今年限
            dataCompany.bank_dsls = $('#forThePrivateWater').val();//公司对私流水
            dataCompany.bank_dgls = $('#ContraryToWater').val();//公司对公流水
            dataCompany.user_id = util.GetQueryString("user_id");//用户ID parseInt(GetQueryString("user_id"))||
            for (var i in dataCompany) {
                var dataCompanys = dataCompany[i];
                IfHaveValue(dataCompanys, i);
            }
            data = dataCompany;

        } else {
            dataContact.social_identity = sessionStorage.getItem("usertype1"); //用户身份
            dataContact.edu_level = sessionStorage.getItem("education1");//教育程度
            dataContact.marry_state = sessionStorage.getItem("marriage1");//婚姻状况
            dataContact.payroll_mode = sessionStorage.getItem("giveOut1");//工资发放形式
            dataContact.car_state = sessionStorage.getItem("car1");//名下有无车产
            dataContact.house_state = sessionStorage.getItem("house1");//名下有无房产
            dataContact.social_security_state = sessionStorage.getItem("security1");//有无连续6个月以上缴纳社保
            dataContact.house_fund_state = sessionStorage.getItem("accumulationFund1");//有无连续6个月以上缴纳公积金
            dataContact.own_credit = sessionStorage.getItem("credit1");//有无信用卡
            dataContact.month_income = $('#monthlyIncome').val();//月收入
            dataContact.user_id = util.GetQueryString("user_id");//获取用户ID  parseInt(util.GetQueryString("user_id"))||

            for (var j in dataContact) {
                var infos = dataContact[j];
                IfHaveValue(infos, j);
            }
            data = dataContact;
        }

        var paramsStr = getparamsStr(data);
        if (!localStorage.getItem("contactInfoSubmit")) {
            mui.alert("请填写紧急联系人信息", '提示', function () {
                console.log(3)
            });
            throw "1";
        }else{
            $("#linkMan").html("已填写");
        }
        var signaturesignature = "";//签名
        var signaturesign = "";
        var header = tool.header;
        header.timestamp = new Date().getTime();
        header.public_key = util.GetQueryString("public_key");//获取公钥
        header.app_key = util.GetQueryString("app_key");//获取app标识
        header.source = util.GetQueryString("source");//用户来源
        header.client_id = util.GetQueryString("client_id");//用户手机唯一标识
        header.channel = util.GetQueryString("channel");//打包渠道
        header.app_version = util.GetQueryString("app_version");//APP版本号
        signaturesign = header.public_key + header.app_key + header.source + header.channel + header.client_id + header.app_version + paramsStr + header.timestamp;
        signaturesignature = hex_md5(signaturesign);
        header.signature = signaturesignature;
        var url = tool.httpsUrl + "/archives/postUserSocialInfo";
        tool.ajax(url, header, data, function (data) {
            if (data.success) {
                var datas = JSON.stringify(data.data);
                window.location.href = "http://new.yytaomeng.com/detail?data=" + datas;
            }
        });
    });
    /*--------------------联系人确认按钮------------------------------------------*/
    $('#contactInfoSubmit').click(function () {
        //定义后台传参
        var data = {
            consume_time: '',
            userUrgentInfoList: '',
            user_id: ''
        };
        //定义过渡对象-------------------获取所有联系人信息

        var userUrgentInfoList = [
            {
                contact_address: '',
                contact_relation: '',
                contact_name: '',
                contact_type: '1',
                contact_phone: ''
            }, {
                contact_address: '',
                contact_relation: '',
                contact_name: '',
                contact_type: '2',
                contact_phone: ''
            }];
        //定义过渡对象-----------------获取所有联系人信息(赋值)
        userUrgentInfoList[0].contact_address = $("#emergencyContactAddress").val();
        userUrgentInfoList[0].contact_relation = sessionStorage.getItem("contact1");
        userUrgentInfoList[0].contact_name = $("#emergencyContactName").val();
        userUrgentInfoList[0].contact_phone = $("#emergencyContactPhone").val();
        userUrgentInfoList[1].contact_relation = sessionStorage.getItem("contact_relation1");
        userUrgentInfoList[1].contact_name = $("#otherContactName").val();
        userUrgentInfoList[1].contact_phone = $("#otherContactPhone").val();
        userUrgentInfoList[1].contact_address = $("#otherContactPhoneAddress").val();
        //判断是否为空
        for (var i in data) {
            var info = data[i];
            for (var j in info) {
                if (info[j] == "") {
                    mui.alert("请完整填写联系人信息！", '提示', function () {
                        console.log(3);
                    });
                    throw"1";
                }
            }
        }
        //判断联系人号码时候正确
        if (util.phone(userUrgentInfoList[0].contact_phone) == "1") {
            if (util.phone(userUrgentInfoList[1].contact_phone) == "1") {
                console.log("电话号码输入正确");
            } else {
                mui.alert("请正确填写其他联系人电话号码!", '提示', function () {
                    console.log(3);
                });
                throw"1";
            }
        }
        else {
            mui.alert("请正确填写直系亲属联系人电话号码!", '提示', function () {
                console.log(3);
            });
            throw "1";
        }
        //用户id
        data.user_id = util.GetQueryString("user_id"); //852437767772422144 1493266469550
        //联系人信息转字符串
        /*      data.userUrgentInfoList=userInfo;*/
        //填写联系人信息所用时间
        data.consume_time = new Date().getTime() - consume_time;
        data.userUrgentInfoList = JSON.stringify(userUrgentInfoList);
        var paramsStr = getencodeURIComponent(data);
        var signaturesignature = "";//签名
        var signaturesign = "";
        var header = tool.header;
        //填写联系人信息签名信息
        header.timestamp = new Date().getTime();
        header.public_key = util.GetQueryString("public_key");// 获取公钥
        header.app_key = util.GetQueryString("app_key");//获取app标识
        header.source = util.GetQueryString("source");//用户来源
        header.client_id = util.GetQueryString("client_id");//用户手机唯一标识
        header.channel = util.GetQueryString("channel");//打包渠道
        header.app_version = util.GetQueryString("app_version");//APP版本号
        signaturesign = header.public_key + header.app_key + header.source + header.channel + header.client_id + header.app_version + paramsStr + header.timestamp;
        //签名信息MD5加密
        signaturesignature = hex_md5(signaturesign);
        header.signature = signaturesignature;
        var url = tool.httpsUrl + "/archives/postUserUrgentInfo";
        tool.ajax(url, header, data, function (data) {
            localStorage.setItem("contactInfoSubmit", true);
            if (data.success) {
                $("#linkMan").html("已填写");
                $("#linkManDetail").css("display", "none");
            }

        });
    });

    /*--------------------职业信息确认按钮------------------------------------------*/
    $('#workBtn').click(function () {
        var data = {
            ad_code: 1,
            ad_path: '',
            company_name: '',
            consume_time: '',
            detail_address: '',
            hire_date: '',
            job_title: '',
            telephone: '',
            user_id: ''
        };
        data.ad_path = sessionStorage.getItem("lou_workcity1");
        data.ad_code = parseInt(sessionStorage.getItem("lou_workcity1_code"));
        data.hire_date = $('#entryTime').html();
        data.company_name = $("#companyNmae").val();
        data.telephone = $('#companyPhone').val();
        data.job_title = $('#companyPosition').val();
        data.detail_address = $('#detaiAddress').val();
        data.user_id = parseInt(util.GetQueryString("user_id"));
        data.consume_time = new Date().getTime() - consume_time;

        var header = tool.header;
        header.public_key = util.GetQueryString("public_key");//获取公钥
        header.app_key = util.GetQueryString("app_key");//获取app标识
        header.source = util.GetQueryString("source");//用户来源
        header.client_id = util.GetQueryString("client_id");//用户手机唯一标识
        header.channel = util.GetQueryString("channel");//打包渠道
        header.app_version = util.GetQueryString("app_version");//APP版本号
        //填写联系人信息签名信息
        for (var i in data) {
            if (data[i] == " ") {
                mui.alert("完整信息", '提示', function () {
                    console.log(3);
                    $('#companyPhone').focus();
                });
                throw "1";
            }
        }
        header.timestamp = new Date().getTime();
        var paramsStr = getparamsStr(data);
        signaturesign = header.public_key + header.app_key + header.source + header.channel + header.client_id + header.app_version + paramsStr + header.timestamp;
        //签名信息MD5加密
        signaturesignature = hex_md5(signaturesign);
        header.signature = signaturesignature;
        var url = tool.httpsUrl + "/archives/postUserJobInfo";
        tool.ajax(url, header, data, function (data) {
            if (data.success) {
                $("#profession").html("已填写");
                $('#professionDetail').css("display", "none");
            }

        });
    })
});